package com.we823.cms.model.sys;

import org.apache.commons.lang3.StringUtils;

public enum ResourceType {
	MENU("menu"), OTHER("other");

	private String name;

	ResourceType(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public static ResourceType parse(String name) {
		if (StringUtils.isEmpty(name)) {
			return OTHER;
		} else {
			name = name.toLowerCase();
			if ("menu".equals(name)) {
				return MENU;
			}else {
				return OTHER;
			}
		}
	}
}
